<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/home/include/init_home.jsp" %>
<%
	String package_type		= StringUtil.nvl(request.getParameter("package_type"));

	HashMap param = new HashMap();
	param.put("recommend_yn", "Y");

	HomeDAO dao = new HomeDAO();

	//추천패키지
	HashList spList = dao.selectPackageList(param);

	//패키지
	param.put("recommend_yn", "");
	param.put("package_type", package_type);
	param.put("package_gubn", "L");
	HashList list1 = dao.selectPackageList(param);

	param.put("package_gubn", "A");
	HashList list2 = dao.selectPackageList(param);

	param.put("package_gubn", "F");
	HashList list3 = dao.selectPackageList(param);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<title><%= HOME_NAME %></title>
<style type="text/css">
</style>
<link href="../css/home.css" rel="stylesheet" type="text/css">
<script>
function fnToggleTab(no) {

		if (no == 1) {
			$('#tab2, #tab3').addClass('hidden');
			$('#tabImg2').attr('src', '../images/sub/01_tab_02_off.gif');
			$('#tabImg3').attr('src', '../images/sub/01_tab_03_off.gif');
		} else if (no == 2) {
			$('#tab1, #tab3').addClass('hidden');
			$('#tabImg1').attr('src', '../images/sub/01_tab_01_off.gif');
			$('#tabImg3').attr('src', '../images/sub/01_tab_03_off.gif');
		} else if (no == 3) {
			$('#tab1, #tab2').addClass('hidden');
			$('#tabImg1').attr('src', '../images/sub/01_tab_01_off.gif');
			$('#tabImg2').attr('src', '../images/sub/01_tab_02_off.gif');
		}

		$('#tab'+no).removeClass('hidden');
		$('#tabImg'+no).attr('src','../images/sub/01_tab_0'+no+'_on.gif');
	}
</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <%@ include file="/home/include/top_menu.jsp" %>
  <tr>
    <td valign="top" align="center" class="sub_con"><table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
      <!-- 좌측 네비 시작-->
        <%@ include file="/home/include/package_menu.jsp" %>
        <!-- 좌측 네비 끝-->
        <td width="50"></td>
        <!-- 컨텐츠 시작-->
        <td valign="top" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><img src="../images/sub/01_title_01.gif" alt="할인패키지" width="122" height="31" /><img src="../images/sub/01_title_sub.gif" width="272" height="18" /></td>
                <td align="right" valign="bottom"></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="5"><img src="../images/sub/sub_line.gif" width="723" height="5" /></td>
          </tr>
          <tr>
            <td height="30"></td>
          </tr>
          <tr>
            <td class="sub_title">추천! 패키지</td>
          </tr>
          <tr>
            <td height="30"></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
     <%	for (int i = 0; i < spList.size(); i+=4) { %>
              <tr>
                <td valign="top" width="25%" style="padding-right:20px">
                	<a href="./packageDetail.jsp?package_id=<%= spList.get("package_id",i) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><img src="<%= spList.get("img_path_00", i) %>" width="165" height="133" /></a>
                	<div class="sub_txt_b"><a href="./packageDetail.jsp?package_id=<%= spList.get("package_id",i) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><%= spList.get("package_name", i) %></a></div>
                  	<div class="sub_txt_red">\<%= StringUtil.toPrice(spList.get("sales_price",i)) %></div>
                </td>
                <td valign="top" width="25%" style="padding-right:20px">
        <%	if (i+1 < spList.size()) { %>
					<a href="./packageDetail.jsp?package_id=<%= spList.get("package_id",i+1) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><img src="<%= spList.get("img_path_00", i+1) %>" width="165" height="133" /></a>
                	<div class="sub_txt_b"><a href="./packageDetail.jsp?package_id=<%= spList.get("package_id",i+1) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><%= spList.get("package_name", i+1) %></a></div>
                  	<div class="sub_txt_red">\<%= StringUtil.toPrice(spList.get("sales_price",i+1)) %></div>
        <%	} %>
				</td>
                <td valign="top" width="25%" style="padding-right:20px">
        <%	if (i+2 < spList.size()) { %>
                	<a href="./packageDetail.jsp?package_id=<%= spList.get("package_id",i+2) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><img src="<%= spList.get("img_path_00", i+2) %>" width="165" height="133" /></a>
                	<div class="sub_txt_b"><a href="./packageDetail.jsp?package_id=<%= spList.get("package_id",i+2) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><%= spList.get("package_name", i+2) %></a></div>
                  	<div class="sub_txt_red">\<%= StringUtil.toPrice(spList.get("sales_price",i+2)) %></div>
        <%	} %>
                </td>
                <td valign="top" width="25%">
        <%	if (i+3 < spList.size()) { %>
					<a href="./packageDetail.jsp?package_id=<%= spList.get("package_id",i+3) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><img src="<%= spList.get("img_path_00", i+3) %>" width="165" height="133" /></a>
                	<div class="sub_txt_b"><a href="./packageDetail.jsp?package_id=<%= spList.get("package_id",i+3) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><%= spList.get("package_name", i+3) %></a></div>
                  	<div class="sub_txt_red">\<%= StringUtil.toPrice(spList.get("sales_price",i+3)) %></div>
        <%	} %>
				</td>
              </tr>

              <tr>
	            <td height="24"></td>
	          </tr>
    <%	} %>

            </table></td>
          </tr>
          <tr>
          	<td height="50"></td>
          </tr>
          <tr>
            <td class="sub_title"><%= menu_name %></td>
          </tr>
          <tr>
          	<td height="30"></td>
          </tr>
          <tr>
          <!--탭시작-->
          	<td class="sub_tab_line"><table width="333" border="0" cellspacing="0" cellpadding="0">
          	  <tr>
          	    <td><a href="#nohref" onclick="fnToggleTab(1)" ><img id="tabImg1" src="../images/sub/01_tab_01_on.gif" alt="지상패키지"  /></a></td>
          	    <td><a href="#nohref" onclick="fnToggleTab(2)" ><img id="tabImg2" src="../images/sub/01_tab_02_off.gif" alt="에어텔" /></a></td>
          	    <td><a href="#nohref" onclick="fnToggleTab(3)" ><img id="tabImg3" src="../images/sub/01_tab_03_off.gif" alt="풀패키지" /></a></td>
                <!--탭끝-->
        	    </tr>
        	  </table></td>
          </tr>
          <tr>
          	<td height="15"></td>
          </tr>
		  <tr id="tab1">
			<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <%	for (int i = 0; i < list1.size(); i++) { %>
				  <tr>
					<td height="123"><table width="100%" border="0" cellspacing="0" cellpadding="0">
					  <tr>
						<td width="145"><a href="./packageDetail.jsp?package_id=<%= list1.get("package_id",i) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><img src="<%= list1.get("img_path_00",i) %>" width="145" height="97" /></a></td>
						<td valign="top" class="thumb_txt2"><a href="./packageDetail.jsp?package_id=<%= list1.get("package_id",i) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><span class="thumb_txt4"><%= list1.get("package_name",i) %></span></a><br /><br />
							- 가격 : \<%= StringUtil.toPrice(list1.get("sales_price",i)) %><br />
							- 지역 : <%= list1.get("location",i) %></td>
						</tr>
					  </table></td>
				  </tr>
				  <tr>
					<td class="sub_bg_line"></td>
				  </tr>
      <%	} %>
				</table>
			</td>
		  </tr>

		  <tr id="tab2" class="hidden">
			<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <%	for (int i = 0; i < list2.size(); i++) { %>
				  <tr>
					<td height="123"><table width="100%" border="0" cellspacing="0" cellpadding="0">
					  <tr>
						<td width="145"><a href="./packageDetail.jsp?package_id=<%= list2.get("package_id",i) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><img src="<%= list2.get("img_path_00",i) %>" width="145" height="97" /></a></td>
						<td valign="top" class="thumb_txt2"><a href="./packageDetail.jsp?package_id=<%= list2.get("package_id",i) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><span class="thumb_txt4"><%= list2.get("package_name",i) %></span></a><br /><br />
							- 가격 : \<%= StringUtil.toPrice(list2.get("sales_price",i)) %><br />
							- 지역 : <%= list2.get("location",i) %></td>
						</tr>
					  </table></td>
				  </tr>
				  <tr>
					<td class="sub_bg_line"></td>
				  </tr>
      <%	} %>
				</table>
			</td>
		  </tr>

		  <tr id="tab3" class="hidden">
			<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <%	for (int i = 0; i < list3.size(); i++) { %>
				  <tr>
					<td height="123"><table width="100%" border="0" cellspacing="0" cellpadding="0">
					  <tr>
						<td width="145"><a href="./packageDetail.jsp?package_id=<%= list3.get("package_id",i) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><img src="<%= list3.get("img_path_00",i) %>" width="145" height="97" /></a></td>
						<td valign="top" class="thumb_txt2"><a href="./packageDetail.jsp?package_id=<%= list3.get("package_id",i) %>&package_type=<%=package_type%>&pmenu_id=<%=pmenu_id %>&menu_id=<%=menu_id %>"><span class="thumb_txt4"><%= list3.get("package_name",i) %></span></a><br /><br />
							- 가격 : \<%= StringUtil.toPrice(list3.get("sales_price",i)) %><br />
							- 지역 : <%= list3.get("location",i) %></td>
						</tr>
					  </table></td>
				  </tr>
				  <tr>
					<td class="sub_bg_line"></td>
				  </tr>
      <%	} %>
				</table>
			</td>
		  </tr>

          <tr>
          	<td height="80"></td>
          </tr>
        </table></td>
        <!-- 컨텐츠 끝-->
      </tr>
    </table></td>
  </tr>
  <%@ include file="/home/include/footer.jsp" %>
</table>
</body>
</html>
